<style>
    .line-selector {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 1px 4px rgba(0,0,0,0.1);
        z-index: 999;
    }

    .line-list {
        display: flex;
        align-items: center;
        padding: 8px 15px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .line-list::-webkit-scrollbar {
        display: none;
    }

    .line-item {
        position: relative;
        padding: 6px 16px;
        border-radius: 20px;
        font-size: 14px;
        color: #666;
        white-space: nowrap;
        margin-right: 12px;
        transition: all 0.3s;
        background: #f5f5f5;
        text-decoration: none;
    }

    .line-item:last-child {
        margin-right: 0;
    }

    .line-item.active {
        background: #1E9FFF;
        color: #fff;
    }

    /* 移动端适配 */
    @media screen and (max-width: 767px) {
        .line-list {
            padding: 8px 10px;
        }
        
        .line-item {
            padding: 5px 14px;
            font-size: 13px;
        }
    }

    /* 适配刘海屏 */
    @supports (padding-top: env(safe-area-inset-top)) {
        .line-selector {
            padding-top: env(safe-area-inset-top);
        }
        #box {
            padding-top: calc(55px + env(safe-area-inset-top));
        }
    }

    /* 修改用户图标样式 */
    .user-profile {
        position: fixed;
        top: 0;
        right: 0;
        height: 55px;
        display: flex;
        align-items: center;
        padding: 0 15px;
        background: linear-gradient(to left, #fff 60%, rgba(255,255,255,0));
        z-index: 1000;
    }

    .user-icon {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f5f5f5;
        color: #666;
        text-decoration: none;
        transition: all 0.3s;
    }

    .user-icon:hover {
        background: #e0e0e0;
    }

    /* 移动端适配 */
    @media screen and (max-width: 767px) {
        .user-profile {
            display: none;
        }
        .line-list {
            padding-right: 10px;
        }
    }

    /* 适配刘海屏 */
    @supports (padding-top: env(safe-area-inset-top)) {
        .user-profile {
            padding-top: env(safe-area-inset-top);
            height: calc(55px + env(safe-area-inset-top));
        }
    }
</style>

<div class="line-selector">
    <div class="line-list">
        <a href="/web/line1/index/" class="line-item" data-line="1" data-line_url="/web/line1/index/">
            1号线
        </a>
        <a href="/web/line2/index/" class="line-item" data-line="2" data-line_url="/web/line2/index/">
            2号线
        </a>
        <a href="/web/line3/index/" class="line-item" data-line="3" data-line_url="/web/line3/index/">
            3号线
        </a>
        <a href="/web/line4/index/" class="line-item" data-line="4" data-line_url="/web/line4/index/">
            4号线
        </a>
    </div>
</div>

<div class="user-profile">
    <a href="/web/me/" class="user-icon">
        👤
    </a>
</div>

<script>
    document.addEventListener('DOMContentLoaded', function() {
        const currentPath = window.location.pathname;
        const lineItems = document.querySelectorAll('.line-item');
        
        lineItems.forEach(item => {
            if (item.getAttribute('href') === currentPath) {
                item.classList.add('active');
            }
        });
    });
</script>
